package com.shapawan.tourism.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shapawan.tourism.entity.LocationType;
import com.shapawan.tourism.mapper.LocationTypeMapper;
import com.shapawan.tourism.service.LocationTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 位置类型Service实现类
 */
@Service
public class LocationTypeServiceImpl extends ServiceImpl<LocationTypeMapper, LocationType> implements LocationTypeService {

    @Override
    public List<LocationType> getEnabledTypes() {
        LambdaQueryWrapper<LocationType> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(LocationType::getStatus, 1)
                   .orderByAsc(LocationType::getSortOrder);
        return list(queryWrapper);
    }
} 